/*
 * @Author: Sian Li lisian_magic@163.com
 * @Date: 2024-07-01 17:20:20
 * @LastEditors: Sian Li lisian_magic@163.com
 * @LastEditTime: 2024-07-04 15:22:31
 * @FilePath: /hudar/src/hudar/src/RadarClass/Common/include/public.h
 * @Description:
 */
#ifndef __PUBLIC_R_H
#define __PUBLIC_R_H
// #define EIGEN_USE_MKL_ALL
#define EIGEN_VECTORIZE_SSE4_2

#include "../../Logger/include/Logger.h"
#include <Eigen/Core>
#include <Eigen/Dense>
#include <fstream>
#include <functional>
#include <future>
#include <iostream>
#include <memory>
#include <mutex>
#include <opencv2/core/eigen.hpp>
#include <opencv2/opencv.hpp>
#include <pcl/common/impl/io.hpp>
#include <pcl/io/pcd_io.h>
#include <queue>
#include <regex>
#include <shared_mutex>
#include <sstream>
#include <stdio.h>
#include <string>
#include <thread>
#include <time.h>
#include <unistd.h>

#include <fcntl.h>
#include <pcl/point_cloud.h>
#include <pcl/point_types.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <termios.h>

#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#include "config.h"

using namespace std;
using namespace Eigen;
using namespace cv;
using namespace pcl;

#ifdef __cplusplus
extern "C++" {
template <typename _Ty, size_t _Size>
char (*__countof_helper(_Ty (&arr)[_Size]))[_Size];

#define __crt_countof(arr) (sizeof(*__countof_helper(arr)) + 0)
}
#endif

/**
 * @brief 一层网络检测框
 */
typedef struct DetectBox {
    DetectBox(float x1 = 0, float y1 = 0, float x2 = 0, float y2 = 0,
              float confidence = 0, float classID = -1, float trackID = -1) {
        this->x1 = x1;
        this->y1 = y1;
        this->x2 = x2;
        this->y2 = y2;
        this->confidence = confidence;
        this->classID = classID;
        this->trackID = trackID;
    }
    float x1, y1, x2, y2;
    float confidence;
    float classID;
    float trackID;
} DetectBox;

/**
 * @brief 装甲板BBox
 */
struct ArmorBoundingBox {
    bool flag = false;
    _Float32 x0 = 0.f, y0 = 0.f, w = 0.f, h = 0.f, cls = 0.f, conf = 0.f,
             depth = 0.f;
};

/**
 * @brief 装甲板BBox和分割Rect绑定包
 */
struct bboxAndRect {
    ArmorBoundingBox armor;
    DetectBox rect;
};

/**
 * @brief 2D坐标
 */
struct MapLocation2D {
    bool flag = false;
    float depth;
    int id = -1;
    int x = 0, y = 0;
};

/**
 * @brief 3D坐标
 */
struct MapLocation3D {
    bool flag = false;
    int id = -1;
    float x = 0., y = 0., z = 0.;
};

/**
 * @brief 比赛信息包
 */
struct BOData {
    bool GameEndFlag = false;
    int remainBO = -1;
};

/**
 * @brief 裁判系统信息包
 */
struct judge_message {
    int task;
    vector<unsigned char> targets;
    unsigned char team;
    vector<MapLocation3D> loc;
};

#endif